package com.ruoyi.web.controller.system;


import com.ruoyi.common.core.page.ResponseResult;
import com.ruoyi.system.domain.Cash;
import com.ruoyi.system.domain.UserCount;
import com.ruoyi.system.service.UserCountService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@Api(tags = "管理后台:用户费率接口")
@RestController
@RequestMapping("/admin/userCount")
public class AdminUserCountController extends AdminController {
    @Resource
    private UserCountService userChannelService;


    @ApiOperation(value = "用户通道列表")
    @GetMapping("list")
    public ResponseResult<List<Cash>> list(UserCount userChannel) {
        this.checkAdmin();
        this.startPage();
        List<UserCount> list = userChannelService.findList(userChannel);
        return this.setSuccessResult(this.getPageResult(list));
    }


    @ApiOperation(value = "详情")
    @GetMapping("getById")
    public ResponseResult get(Long id) {
        this.checkAdmin();
        UserCount zfbConfig = userChannelService.getById(id);

        return this.setSuccessResult(zfbConfig);
    }

}
